package br.com.dataphonebr.selectListener;

import java.util.List;

import android.content.Context;
import android.widget.Spinner;
import br.com.dataphonebr.R;
import br.com.dataphonebr.entity.Grupo;


public class GrupoSelectedListener extends CustomOnItemSelectedListener<Grupo> {

	public GrupoSelectedListener(Context context) {
		this.context = context;
	}

	public void createAdapter(List<Grupo> list, Spinner spinner, boolean all) {
		Grupo grupo = new Grupo();
		grupo.setNome(context.getString(R.string.all_text));
		list.add(0, grupo);
		super.createAdapter(list, spinner);
		spinner.setSelection(0);
	}
	
	@Override
	public void createAdapter(List<Grupo> list, Spinner spinner) {
		spinner.setPrompt("Grupos");
		Grupo grupoAux = new Grupo();
		grupoAux.setNome(context.getString(R.string.none_selection_lbl));
		list.add(0, grupoAux);
		super.createAdapter(list, spinner);
		spinner.setSelection(0);
	}
}
